﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Web.UI;
using DevExpress.Web.ASPxHeadline;
using DevExpress.Web.ASPxClasses;
using DevExpress.Web.ASPxCallback;

using LMD.Constant;
using LMD.Lib.DataClass;
using LMD.Lib.Interface;


public partial class Notifications : ICPGeneralPage
{

    #region Properties
    #endregion Properties

    #region Event Handlers

    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

        Page.Title = "ICP Lintasarta: Notifications";
        if (!IsPostBack && !IsCallback)
        {
            pnlCPTitle.InnerHtml = "Notifications";

            pnlNotifications.InnerHtml = GetNotifContent();
        }
    }
    #endregion Event Handlers

    #region Custom Methods
    private String GetNotifContent()
    {
        String sxReturn = String.Empty;

        Cached.NotificationTable ccNotif = new Cached.NotificationTable();

        foreach (NotificationData nfData in ccNotif.GetNotificationList(ICPUser.ID, 0, true))
        {
            sxReturn += nfData.BuildNotificationItem();
        }

        DBQuery.NotificationTable.SetNotificationAsRead(ICPUser.ID);
        return sxReturn;
    }

    protected override void DoSearch(String sxSearchQuery)
    {
        throw new NotImplementedException();
    }
    
    #endregion Custom Methods
}
